package com.mingqi.enetconnected.net.util;

import com.google.gson.reflect.TypeToken;
import com.mingqi.enetconnected.data.bean.order.OrderBrief;
import com.mingqi.enetconnected.data.bean.order.OrderDetail;
import com.mingqi.enetconnected.net.model.GeneralResponse;

import java.lang.reflect.Type;
import java.util.List;

public class DataTest {
    private static String OrderItemsList_value = "{\"datas\":[{\"address\":\"南门新村\",\"bizCode\":\"installation\",\"bookTime\":\"2018-08-08 10:02:21\",\"cancelReason\":\"无\",\"channelId\":\"WX\",\"completedTime\":\"2018-08-08 10:02:21\",\"createTime\":\"2018-08-08 10:02:21\",\"custId\":\"1\",\"custName\":\"大刘杰\",\"custOrderCode\":\"1\",\"evaluateFlag\":\"Y\",\"event\":\"C\",\"memberId\":\"1\",\"orderCode\":\"a1237823720\",\"orderState\":\"Y\",\"orgId\":\"2\",\"orgName\":\"2\",\"partCode\":\"liuzx\",\"partName\":\"季昌盛\",\"partType\":\"1\",\"paymentFlag\":\"Y\",\"phoneNum\":\"13285145555\",\"planId\":\"2\",\"priority\":1,\"stateTime\":\"2018-08-08 10:02:21\",\"subBizCode\":\"bizCd001\",\"subsCode\":\"1400000001\",\"visitTime\":\"2018-08-08 10:02:21\"},{\"address\":\"南门新村\",\"bizCode\":\"installation\",\"bookTime\":\"2018-08-07 01:1-10:00\",\"channelId\":\"0c188735371011e89d85fa163eaec8a3\",\"createTime\":\"2018-08-29 07:02:20\",\"custId\":\"1\",\"custName\":\"大刘杰\",\"custOrderCode\":\"1\",\"evaluateFlag\":\"Y\",\"event\":\"C\",\"memberId\":\"1\",\"orderCode\":\"12\",\"orderState\":\"U\",\"orgId\":\"1\",\"orgName\":\"测试组织机构\",\"partCode\":\"liuzx\",\"partName\":\"季昌盛\",\"partType\":\"1\",\"paymentFlag\":\"Y\",\"phoneNum\":\"13285145555\",\"planId\":\"4\",\"priority\":1,\"stateTime\":\"2018-08-29 07:02:07\",\"subBizCode\":\"repair\",\"subsCode\":\"1400000001\",\"urgeCount\":0,\"visitTime\":\"2018-08-29 06:56:36\",\"warningFlag\":\"Y\"}],\"pageIndex\":1,\"pageSize\":3,\"totalSize\":2}";

    public static GeneralResponse<List<OrderBrief>> getOrderItemsList() {
        Type type = new TypeToken<GeneralResponse<List<OrderBrief>>>() {
        }.getType();
        GeneralResponse<List<OrderBrief>> data = Convert.fromJson(OrderItemsList_value, type);
        return data;
    }

    private static String OrderItemDetail_value = "[{\"acctId\":\"2\",\"bizCode\":\"installation\",\"bookTime\":\"01:1-10:00\",\"cancelReason\":\"客户\",\"channelId\":\"0c188735371011e89d85fa163eaec8a3\",\"comments\":\"1\",\"createBy\":\"1\",\"custOrderId\":\"2\",\"evaluateFlag\":\"Y\",\"fullAddress\":\"南门新村\",\"gridId\":\"2\",\"id\":\"8a8a8c11659d971a01659e056b3c0002\",\"lastUrgeTime\":\"2018-09-03 14:01:20\",\"location\":\"116.396793,39.908839\",\"memberId\":\"7\",\"operationType\":\"4\",\"orderCode\":\"a1237823724\",\"orderItemId\":\"9\",\"orderState\":\"F\",\"orgId\":\"1\",\"orgName\":\"测试组织机构\",\"partCode\":\"10033220\",\"partName\":\"季昌盛\",\"partType\":\"CRM\",\"paymentFlag\":\"Y\",\"planId\":\"1\",\"priority\":1,\"processId\":\"1\",\"recUserId\":\"0\",\"recUserName\":\"超级管理员\",\"spId\":\"0\",\"subBizCode\":\"repair\",\"subsId\":\"9\",\"urgeCount\":22,\"warnCount\":\"0\",\"warningFlag\":\"Y\"}]";

    public static OrderDetail getOrderItemDetail() throws Exception {
        Type type = new TypeToken<OrderDetail>() {
        }.getType();
        OrderDetail data = Convert.fromJson(OrderItemDetail_value, type);
        return data;
    }

    private static String ORDERPLAN_value = "[{\"beginTime\":570,\"bookNum\":66,\"bookTime\":\"09:30-14:30\",\"endTime\":870,\"platDate\":\"2018-09-11\",\"platId\":\"2c90e5d065b369cd0165b72dbde300cb\",\"recommendFlag\":\"Y\",\"staffs\":[{\"bookNum\":66,\"schePlanId\":\"2c90e5d065b369cd0165b72dbde300cb\",\"staffId\":\"e376d466c55242f1abc0635fdade814c\",\"staffName\":\"吴涛\"}]},{\"beginTime\":570,\"bookNum\":66,\"bookTime\":\"09:30-14:30\",\"endTime\":870,\"platDate\":\"2018-09-12\",\"platId\":\"2c90e5d065b369cd0165b72dbdf500d1\",\"recommendFlag\":\"N\",\"staffs\":[{\"bookNum\":66,\"schePlanId\":\"2c90e5d065b369cd0165b72dbdf500d1\",\"staffId\":\"e376d466c55242f1abc0635fdade814c\",\"staffName\":\"吴涛\"}]}]";

    public static List<Object> getOrderPlan() throws Exception {
        Type type = new TypeToken<List<Object>>() {
        }.getType();
        List<Object> data = Convert.fromJson(ORDERPLAN_value, type);
        return data;
    }

//    AdRemoteRequest
    private static String AdInfo_value = "[{\"adBanner\": \"home\",\"adBannerType\": \"app\",\"adImg\": \"http://erp-goods.oss-cn-shanghai.aliyuncs.com/img-openapi/0image20180823142407748.png\",\"adThumbImg\": \"http://erp-goods.oss-cn-shanghai.aliyuncs.com/img-openapi/0image20180823142407748.png?x-oss-process=image/resize,w_200\",\"adUrl\": \"www.baidu.com\",\"id\": \"4ef45ac5ab0c4413a543f08a24fc1c32\"},{\"adBanner\": \"home\",\"adBannerType\": \"app\",\"adImg\": \"http://erp-goods.oss-cn-shanghai.aliyuncs.com/img-openapi/0image20180823134515733.jpg\",\"adThumbImg\": \"http://erp-goods.oss-cn-shanghai.aliyuncs.com/img-openapi/0image20180823134515733.jpg?x-oss-process=image/resize,w_200\",\"adUrl\": \"www.baidu.com1\",\"id\": \"ad9b9e59c6214144a900ce523931baca\"}]";

    public static List<Object> getAdInfo() throws Exception {
        Type type = new TypeToken<List<Object>>() {
        }.getType();
        List<Object> data = Convert.fromJson(AdInfo_value, type);
        return data;
    }



}
